#ifndef _COMPLEX_TRAIL_H_
#define _COMPLEX_TRAIL_H_


#include <string>
#include "math/vec2.h"
#include "math/counter.h"

class	Image;

namespace vfx
{
class	ComplexTrail
{

public:
						ComplexTrail();
	virtual				~ComplexTrail();
	void				Tick(float dt);	
	void				Render(const math::Vec2& Offset, float Scale);
	void				UpdatePos(const math::Vec2& Pos);
	void				CreateNodes(float	GenTime, float Timout);
	void				SetImage(const std::string& Name);
	void				SetWidth(float Width) { m_Width = Width; };
	void				SetAdditive(bool b) { m_Additive = b; };
	void				Clear();
private:
	void				CopyNodes();
	math::Counter		m_AddNode;
	math::Counter		m_DropNode;

	int					m_NodeC;
	int					m_LowNode;
	int					m_HighNode;
	math::Vec2*			m_NodeA;
	float				m_Width;
	bool				m_Additive;
	Image*				m_pImage;


	float				m_GenTime, m_Timeout;
};

} // vfx effects

#endif // _COMPLEX_TRAIL_H_